package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.TurntableB224;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class TurntableB224Converter implements AttributeConverter<TurntableB224, String> {
    @Override
    public String convertToDatabaseColumn(TurntableB224 turntableB224) {
        return JSONUtil.toJsonStr(turntableB224);
    }

    @Override
    public TurntableB224 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, TurntableB224.class);
    }
}
